import VueRouter from 'vue-router'

//导入路有对象
import HomeContainer from './components/tarbars/HomeContainer.vue'
import MemberContainer from './components/tarbars/MemberContainer.vue'
import SearchContainer from './components/tarbars/SearchContainer.vue'
import ShopCarContainer from './components/tarbars/ShopCarContainer.vue'
import news from './components/newsList/news.vue'
import NewsInfo from './components/newsList/NewsInfo.vue'
import photos from './components/photos/photos.vue'
import photoinfo from './components/photos/photoinfo.vue'
import goodsList from './components/goods/goodsList.vue'
import goodsInfo from './components/goods/goodsInfo.vue'
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomment from './components/goods/goodscomment.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
  {path:'/',redirect:'/home'},
   {path:'/home',component:HomeContainer},
   {path:'/member',component:MemberContainer},
   {path:'/search',component:SearchContainer},
   {path:'/shopcar',component:ShopCarContainer},
   {path:'/home/news',component:news},
   {path:'/home/newsinfo/:id',component:NewsInfo},
   {path:'/home/photos',component:photos},
   {path:'/home/photoinfo',component:photoinfo},
   {path:'/home/goodsList',component:goodsList},
   {path:'/home/goodsInfo',component:goodsInfo},
   {path:'/home/goodsdesc',component:goodsdesc,name:"goodsdesc"},
   {path:'/home/goodscomment',component:goodscomment,name:"goodscomment"},
  ],
  linkActiveClass: 'mui-active'  //默认选中路由显示的类 覆盖为mui的类让其高亮
})

// 把路由对象暴露出去 根据不同的路由变化 暴露不同的component模板出去
export default router